package com.tengju.bff.interfaces.manage.common.assembler;

import com.tengju.bff.interfaces.shared.KVVO;
import com.tengju.data.domain.model.user.UserLevelEnum;
import com.tengju.motivation.domain.shared.DateType;
import com.tengju.support.domain.model.article.ArticleType;
import com.tengju.support.domain.model.resource.Position;
import com.tengju.support.domain.model.resource.ResourceOrientation;
import com.tengju.user.domain.model.sign.CrmStarSignStatus;
import com.tengju.user.domain.model.sign.StarSignStatus;
import com.tengju.user.domain.model.user.StarLevelEnum;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class CommonManageAssembler {

    public static List<KVVO<String, Integer>> getArticleTypes() {
        return Arrays.stream(ArticleType.values())
                .map(articleType -> KVVO.of(articleType.getDesc(), articleType.getVal()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getResourcePositions() {
        return Arrays.stream(Position.values())
                .map(position -> KVVO.of(position.getDesc(), position.getVal()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getResourceOrientations() {
        return Arrays.stream(ResourceOrientation.values())
                .map(orientation -> KVVO.of(orientation.getDesc(), orientation.getValue()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getStarLevels() {
        return Arrays.stream(StarLevelEnum.values())
                .map(starLevel -> KVVO.of(starLevel.getDesc(), starLevel.getCode()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getStarLevelsShortName() {
        return Arrays.stream(StarLevelEnum.values())
                .map(starLevel -> KVVO.of(starLevel.getShortName(), starLevel.getCode()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getStarSignStatus() {
        return Arrays.stream(StarSignStatus.values())
                .map(starSignStatus -> KVVO.of(starSignStatus.getDesc(), starSignStatus.getVal()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getCrmStarSignStatus() {
        return Arrays.stream(CrmStarSignStatus.values())
                .map(starSignStatus -> KVVO.of(starSignStatus.getDesc(), starSignStatus.getVal()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getUserLevels() {
        return Arrays.stream(UserLevelEnum.values())
                .map(userLevel -> KVVO.of(userLevel.getLevelDesc(), userLevel.getCode()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getDateTypeList() {
        return Arrays.stream(DateType.values())
                .map(dateType -> KVVO.of(dateType.getDesc(), dateType.getVal()))
                .collect(Collectors.toList());
    }
}
